package com.chb.jblog.web.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

import com.chb.jblog.entity.Links;
import com.chb.jblog.service.LinkService;

@Controller
public class Index {
	@Autowired
	private LinkService linkService;
	@RequestMapping(value={"","/","/index","/index.html"})
	public String index(ModelMap map){
		List<Links> friendLinks = linkService.selectByParameter(null);
		map.put("navSelect", "index");
		map.put("friendLinks", friendLinks);
		return "qiye/index";
	}
	@RequestMapping(value={"/about","/about.html"})
	public String about(ModelMap map){
		map.put("navSelect", "about");
		return "qiye/about";
	}
	@RequestMapping(value={"/chat","/chat.html"})
	public String chat(ModelMap map){
		map.put("navSelect", "about");
		return "websocket/index";
	}
}
